package com.hzsoft.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.BodyTagSupport;

import com.hzsoft.util.name.ToName;


/**
 * <p>
 * 类描述：主要用于姓名加密的显示
 * </p>
 * <p>
 * 创建人：liuyidong <br>
 * 创建时间：2012-4-18 上午9:32:33
 * </p>
 */
public class NameDisplay extends BodyTagSupport {
	
	private static final long serialVersionUID = -2293053635661017044L;
	
	@Override
	public int doStartTag() throws JspException {
		return EVAL_BODY_INCLUDE;
	}
	@Override
	public int doEndTag() throws JspException {
		try {
			StringBuffer results = new StringBuffer("");
			String name=ToName.Decryption(value.trim());
			results.append(name);
			pageContext.getOut().write(results.toString());
		} catch (IOException ex) {
			throw new JspTagException("错误");
		}
		return EVAL_PAGE;
	}
	// list只是传递一个标识，具体下拉值内容是从数据库取还是从请求中得到为不同具体实现	
	protected String value;		
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	
}